package week0222;

import java.util.Scanner;

public class Demo1 {
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
	
		int s=0, f=1,c;
		
		int m=in.nextInt();
		while(f<=m){
			switch (f) {
			case 1:c=0;break;
			case 5:
			case 7:
			case 10:
			case 12:c=30;break;
			case 3:c=28;break;
			default:c=31;break;
			}
			f++;
			s=s+c;
	}
		System.out.println(s);

}
}